package de.hska.pwmanager.controller.internal;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import de.hska.pwmanager.controller.interfaces.ICRUD;
import de.hska.pwmanager.persistence.model.PasswordUserHash;
import de.hska.pwmanager.persistence.model.dao.PasswordUserHashDao;

@Component
public class PasswordUserHashController implements ICRUD<PasswordUserHash> {
	@Autowired
	private PasswordUserHashDao passwordUserHashDao;
	
	public List<PasswordUserHash> readAll() {
		return this.passwordUserHashDao.readAll();
	}

	public void createOrUpdate(PasswordUserHash toCreateOrUpdate) {
		this.passwordUserHashDao.save(toCreateOrUpdate);
	}

	public void delete(Long primaryKey) {
		this.passwordUserHashDao.delete(this.passwordUserHashDao.readByPrimaryKey(primaryKey));
	}

	public void validate(PasswordUserHash toValidate) {
		// TODO Auto-generated method stub
		
	}

	public PasswordUserHash readByPK(Long pk) {
		return this.passwordUserHashDao.readByPrimaryKey(pk);
	}

}
